﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<%@ Import Namespace="DoubanApi.Models" %>
<%@ Import Namespace="ZYStudios.Models" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <script src="../../Scripts/jquery-1.6.2.min.js" type="text/javascript"></script>
    <link href="../../Content/themes/base/jquery.ui.all.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/jquery.ui.core.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.ui.widget.js" type="text/javascript"></script>
    <script src="../../Scripts/jquery.ui.tabs.js" type="text/javascript"></script>
    <link href="../../Content/Playtime.css" rel="stylesheet" type="text/css" />
    <link href="../../Content/NewMovie.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        $(function () {
            var $tabs=$("#tabs").tabs();
            <%if(ViewData["PlayLineSelect"]!=null){ %>
            $tabs.tabs('select',<%=ViewData["PlayLineSelect"]%>);
            <%} %>

        });
    </script>
    <style type="text/css">
        .submit {
        width: 100px;
        line-height: 13px;
        color: #333;
        border: 1px solid #CACACA;
        background: white;
        padding: 5px;
        margin-right: 5px;
        display: inline;
        vertical-align: middle;
        margin-left:7px;
        cursor: pointer;
        }
    </style>
</head>
<body>
    <%Html.BeginForm("PlaytimeEditPanelSubmit", "Admin", FormMethod.Post, null); %>
    <% List<ZYStudios.Models.PlaytimeModel> PlaytimeModels = ViewData["PlayTimeData"] as List<PlaytimeModel>; %>
    <div class="PageContent">
        <input type="submit" class="submit" value="保存修改" />
        <br />
        <div class="Playtime">
            <div id="tabs">
                <ul>
                    <%foreach (ZYStudios.Models.PlaytimeModel model in PlaytimeModels)
                      { %>
                      <li><a href='<%="#"+model.ToString() %>'><%=model.PlayData %></a></li>
                    <%} %>
                </ul>
                <% int count = 0; %>
                <%foreach (PlaytimeModel model in PlaytimeModels)
                  {%>
                      <div id='<%=model.ToString() %>'>
                       <% List<PlaytimeItemModel> PlaytimeItemModels = model.Movies as List<PlaytimeItemModel>;%>
                       <span class="PlaytimeEditList">
                       <%foreach (PlaytimeItemModel item in PlaytimeItemModels)
                         { %>
                         
                         <li>
                         <a><%="<img style='border:0' src='" + item.Movie.ImageLink + "' alt='' />"%></a>
                         <input type="hidden" name="<%="aPlaytimeItemList["+count.ToString()+"].ParentId" %>" value="<%=item.ParentId %>" />
                         <input type="hidden" name="<%="aPlaytimeItemList["+count.ToString()+"].Id" %>" value="<%=item.Id %>" />
                         <span>片名:</span>
                         <span class="MovieTitle"><input type="text" name="<%="aPlaytimeItemList["+count.ToString()+"].MovieName" %>" value="<%=item.MovieName %>" /></span>
                         <br />
                         <span>片长:</span>
                         <span><input type="text" name="<%="aPlaytimeItemList["+count.ToString()+"].MovieDuration" %>" value="<%=item.MovieDuration %>" /></span>
                         <br />
                         <span style="vertical-align: top;">排片:</span>
                         <span class="time" ><textarea name="<%="aPlaytimeItemList["+count.ToString()+"].PlayTime" %>" style="width: 182px;margin-left: 2px;height: 80px;margin-top: 2px;"><%=item.PlayTime %></textarea></span>
                         </li>

                         <% count++; %>
                       <%} %>
                       </span>
                       <div style="clear:both;height:0px;"></div>
                      </div>
                    <%} %>
            </div>
        </div>
    </div>
    
    <%Html.EndForm(); %>
</body>
</html>
